Repository navigation
fix(gql): Remove credentials and query values from the transport URL - #8227
Open
Mohil-Ahuja wants to merge 1 commit into
Open
Mohil-Ahuja wants to merge 1 commit into
Mohil-Ahuja wants to merge 1 commit into
Conversation
The integration copied transport.url into event["request"]["url"] unchanged, so credentials and query tokens in the URL were sent with every event, whatever send_default_pii was set to. Sanitize it with parse_url and send the filtered query in query_string.
Mohil-Ahuja
marked this pull request as ready for review
November 9, 2026 09:35
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The gql integration copied
transport.urlintoevent["request"]["url"]unchanged, so credentials and query tokens in the URL were sent with every event, whateversend_default_piiwas set to.The URL now goes through
parse_url. The authority is filtered inurl, and the query goes toquery_string.One change from what I suggested in the issue: I kept
parse_url's default sanitizing instead ofsanitize=False. Withsanitize=False, a token such asaccess_token=...would only move fromurltoquery_stringand still be sent. Query values are now always[Filtered], with the keys kept, even withsend_default_pii=True. If you'd rather keep the values when PII is enabled, that's a small change.The URL is passed through
str()because some transports accept a URL object as well as a string. If parsing fails,urlis left out of the event.I ran
tests/integrations/gqlthrough tox onpy3.10-gql-v3.4.1,py3.14-gql-v4.4.0andpy3.14-gql-latest, plus ruff and mypy. Without the change, the new sanitizing tests fail.Issues